#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;

double calcul(double x1, double x2, double y1, double y2) {
	double temp = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));

	return temp;
}


void solve1() {
	double x1, y1, x2, y2, x3, y3;
	cin >> x1 >> y1;
	cin >> x2 >> y2;
	cin >> x3 >> y3;
	double c;
	c = calcul(x1, x2, y1, y2) + calcul(x2, x3, y2, y3) + calcul(x1, x3, y1, y3);
	//c = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2)) + sqrt(pow(x2 - x3, 2) + pow(y2 - y3, 2)) + sqrt(pow(x3 - x1, 2) + pow(y3 - y1, 2));
	printf("%.2f", c);
	return ;
}

bool isleap_year(int x) {
	if (x % 400 == 0 || (x % 4 == 0 && x % 100 != 0)) 
		return true;
	
	return false;

}

void solve2() {
	int x, y;
	vector<int> result;
	cin >> x >> y;
	int a2count = 0;
	for (int i = x; i <= y; ++i) {
		if (isleap_year(i)) {
			a2count++;
			result.push_back(i);
		}
			
	}
	cout << a2count << '\n';
	for (int a : result)
		cout << a << " ";

	return;
}

bool is_prime(int x) {
	if (x <= 1)
		return false;

	for (int i = 2; i <= sqrt(x); ++i) {
		if (x % i == 0)
			return false;
	}

	return true;
}

int a3[110];
void solve3() {
	int n;
	cin >> n;
	for (int i = 1; i <= n; ++i) 
		cin >> a3[i];

	for (int i = 1; i <= n; ++i) {
		if (is_prime(a3[i]))
			cout << a3[i] << " ";
	}

	return;
}


void solve4() {
	int n;
	cin >> n;
	int a4 = 1;
	while (n) {
		a4 *= n;
		--n;
	}
	cout << a4;
	return;
}

int digui(int x) {
	if (x == 1)
		return 1;

	return x * digui(x - 1);
}


void solve5() {
	int n;
	cin >> n;
	int a5 = digui(n);
	cout << a5;
	return;
}


int a6[20];
void solve6() {
	int n, m;
	cin >> n >> m;
	double max = 0;
	int all = 0;
	double mean = 0;
	for (int i = 1; i <= n; ++i) {
		
		for (int j = 1; j <= m; ++j) {
			cin >> a6[j];
		}
		sort(a6 + 1, a6 + 1 + m);
		all = 0;
		for (int j = 2; j < m; ++j) {
			all += a6[j];
		} 
		mean = (double)all / (m - 2);
		max = mean > max ? mean : max;
		
	}
	printf("%.2f",max);

	return;
}

void solve7() {
	int n;
	cin >> n;
	int a7count = 1;
	for (int i = 1; i < n; ++i) {
		a7count = (a7count + 1) * 2;
	}
	cout << a7count;

	return;
}

typedef long long ll;
//二进制枚举(TLE超时,不行,2^30)
int a8[30];
void solve8() {
	ll result = 0;
	int n = 0;
	int trp;
	int j = 0;
	while (cin >> trp) {
		a8[j++] = trp;
		n++;
	}
	for (int yuansu = 0; yuansu < (1 << n); ++yuansu) {
		for (int i = 0; i < n; ++i) {
			int temp = yuansu >> i & 1;
			if (temp != 0) {
				result += a8[i];
			}
		}

	}
	cout << result;

	return;
}

int a9[40];
void solve9() {

	ll result = 0;
	
	int trp;
	int j = 0;
	while (cin >> trp) {
		a9[j++] = trp;		
	}
	for (int i = 0; i < j; ++i) {
		result += a9[i];
	}
	// cout << 1ll*result * pow(2, j - 1);
	cout << result * (1<< j - 1);
	//不要pow了，返回double类型，有精度损失，位运算符效果更好

	return;
}


void solve10() {
	int n;
	cin >> n;
	string s;
	int a, b;

	for (int i = 1; i <= n; ++i) {
		cin >> s;
		cin >> a >> b;
		cout << s << " ";
		cout << a + 1 << " ";
		if (b * 1.2 <= 600)
			cout << b * 1.2 << " ";

		else
			cout << 600 << " ";
		cout << '\n';

	}

	return;
}

void solve11() {
	int n;
	cin >> n;
	string s;
	int a, b, c;
	string s1;
	int a1 = -1, b1 = -1, c1 = -1;
	for (int i = 1; i <= n; ++i) {
		cin >> s >> a >> b >> c;
		if (a + b + c > a1 + b1 + c1) {
			a1 = a; b1 = b; c1 = c;
			s1 = s;
		}
	}
	cout << s1 << " " << a1 << " " << b1 << " " << c1;

	return ;
}


const int N = 2e6 + 10;
int a12[N];
void solve12() {
	int n, m;
	cin >> n >> m;
	for (int i = 1; i <= m; ++i) {
		cin >> a12[i];
	}
	sort(a12 + 1, a12 + m + 1);
	for (int i = 1; i <= m; ++i) {
		cout << a12[i] << " ";
	}
	

	return;
}




int main() {

	//solve1();
	//solve2();
	//solve3();
	//solve4();
	//solve5();
	//solve6();
	//solve7();
	//solve8();
	//solve9();
	//solve10();
	//solve11();
	solve12();
	return 0;
}

